/*
 * Copyright (c) 2018-2999 九五云信息科技有限公司 All rights reserved.
 *
 * https://www.gz-yami.com/
 *
 * 未经允许，不可做商业用途！
 *
 * 版权所有，侵权必究！
 */

package com.yami.shop.dao;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.yami.shop.bean.model.OrderSettlement;
import org.apache.ibatis.annotations.Param;

import java.util.List;

public interface OrderSettlementMapper extends BaseMapper<OrderSettlement> {

	void updateByOrderNumberAndUserId(@Param("orderSettlement") OrderSettlement orderSettlement);

	List<OrderSettlement> getSettlementsByPayNo(@Param("payNo") String payNo);

	void updateSettlementsByPayNo(@Param("outTradeNo") String outTradeNo, @Param("transactionId") String transactionId);

	int updateToPay(@Param("payNo") String payNo,@Param("bizPayNo") String bizPayNo, @Param("version") Integer version);

	double getSumAmountByNum(@Param("orderNumber") String orderNumber);

	/**
	 * 获取支付的时候的支付金额
	 * @param payNo
	 * @return
	 */
    double getPayAmountWhenPay(String payNo);

	/**
	 *  通过订单编号获取订单支付信息列表，并去掉有重复的订单支付数据
	 * @param orderNumbers 订单编号列表
	 * @return 订单支付信息
	 */
	List<OrderSettlement> listByOrderNumbers(@Param("orderNumbers") List<String> orderNumbers);

	/**
	 * 查询出微信支付并且为二维码支付的
	 * @return 订单支付信息
	 */
	List<OrderSettlement> listByPayTypeAndTime();
}
